using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(SpriteRenderer))]
public class Exclamation:MonoBehaviour {
	void Start() {
		timer=0;
		spriteRenderer=GetComponent<SpriteRenderer>();
	}

	void Update() {
		timer+=Time.deltaTime;
		float speed = 0.5f-timer;
		float alpha = 1-2*timer;

		transform.position=transform.position+Vector3.up*speed*Time.deltaTime;
		spriteRenderer.color=new Color(1,1,1,alpha);

		if(timer>0.5f) Destroy(gameObject);

	}

	SpriteRenderer spriteRenderer;
	float timer;
}